﻿// code03020205.cpp : 字符串
//  两个string对象相加、字面值和string对象相加

#include <iostream>
#include <string>
using namespace std;

int main()
{
    string s1 = "hello", s2 = "world\n";
    string s3 = s1 + s2;
    s1 += s2;
    cout << s1 << s3 << endl;

    string s4 = s1 + "," + s2;
    string s5 = "hello" + ",";//报错！字面量无法直接转换为string类型
    string s6 = "hello" + s1;
    cout << s4 << s6 << endl;

    return 0;
}

